package huajiu.com.controller;

import huajiu.com.domain.Test;
import huajiu.com.service.TestService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    
	@Autowired
	TestService  testService;
	@ResponseBody
	@RequestMapping(value="/test",method=RequestMethod.GET)
	public String testStr(@RequestParam String name, int age){
		String srt ="测试成功";
		Test test =new Test();
		test.setAge(1);
		test.setName("pjq");
		test.setId(0);
		testService.save(test);
		System.out.println(name);
		return srt;
	}
}
 